
var utils = {
    apiDomain: 'http://101.71.130.40:18080/xinman/',
    formatTime: function (date) {//格式化为借口所需时间格式
        return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds()
    },
    formatDisplayTime: function (time, type) {//格式化成X轴显示的时间
        if (type == 's') {
            var s = time.getSeconds(),
                h = time.getHours(),
                m = time.getMinutes();
            s = s >= 10 ? s : '0' + s;
            m = m >= 10 ? m : '0' + m;
            return h + ':' + m + ':' + s;
        } else if (type == 'm') {
            var
                h = time.getHours(),
                m = time.getMinutes();
            return h + ':' + m
        } else if (type == 'h') {
            var
                h = time.getHours();
            return h + '时'
        }

    },
    login: function () {
        $.ajax({
            url: utils.apiDomain + 'admin/doLogin',
            xhrFields: {
                withCredentials: true
            },
            crossDomain: true,
            type: 'POST',
            data: {
                account: 'test',
                password: 'test'
            },
            success: function (data) {
                unlogin(data)

            }
        });

    }
};